import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *


class MyWindow(QWidget):
    def __init__(self):
        super(MyWindow, self).__init__()
        self.setWindowTitle('message')
        self.resize(300, 100)
        self.myButton = QPushButton(self)
        self.myButton.setText('click')
        self.myButton.clicked.connect(self.msg3)

    def msg1(self):
        reply = QMessageBox.information(self, 'title', 'info', QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
        print(reply)

    def msg2(self):
        reply = QMessageBox.about(self, 'title', 'about')
        print(reply)

    def msg3(self):
        reply = QMessageBox.critical(self, 'title', 'critical', QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
        print(reply)

    def msg4(self):
        reply = QMessageBox.question(self, 'title', 'question', QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
        print(reply)

    def msg5(self):
        reply = QMessageBox.warning(self, 'title', 'warning', QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
        print(reply)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    myshow = MyWindow()
    myshow.show()
    sys.exit(app.exec_())
